package com.fh.module_main.adapter

import android.content.Context
import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.fh.lib_base.data.bean.BannerBean
import com.fh.module_main.R
import com.zhpan.bannerview.BaseViewHolder

class HomeBannerViewHolder(view: View) : BaseViewHolder<BannerBean>(view) {

    override fun bindData(data: BannerBean?, position: Int, pageSize: Int) {
        val img = itemView.findViewById<ImageView>(R.id.bannerhome_img)

        data?.let {
            Glide.with(img)
                .load(it.pictureUrl)
                .transition(DrawableTransitionOptions.withCrossFade(500))
                .into(img)
        }
    }

}
